<template>
  <buyhoro :goodList="goodList" @del="fn"></buyhoro>
</template>

<script>
import buyhoro from "./components/App.vueday 04 作业1组件.vue";

export default {
  components: {
    buyhoro,
  },
  data() {
    return {
      goodList: [
        {
          name: "诸葛亮",
          price: 1000,
          num: 1,
          checked: false,
        },
        {
          name: "蔡文姬",
          price: 1500,
          num: 1,
          checked: false,
        },
        {
          name: "妲己",
          price: 2000,
          num: 1,
          checked: false,
        },
        {
          name: "鲁班",
          price: 2200,
          num: 1,
          checked: false,
        },
      ],
    };
  },

  methods: {
    fn(name) {
      this.goodList = this.goodList.filter((item) => item.name !== name);
    },
  },
};
</script>

<style>
</style>